package com.atguigu.day31.forword01;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

/**
 * @version 1.0
 * @Author 马冰
 * @Date 2024/12/10 9:41
 * @注释
 */
@WebServlet("/ServletB")
public class ServletB extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("ServletB 服务启动了");


        req.getRequestDispatcher("WEB-INF/message.html").forward(req, resp);
        resp.getWriter().println("ServletB Success");
    }
}
